package com.jingdianjichi.subject.common.enums;

import lombok.Data;


public enum CategoryTypeEnums {
    PRIMARY(1, "一级分类"),
    SECOND(0, "二级分类");

    private int code;
    private String desc;

    CategoryTypeEnums(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static CategoryTypeEnums getCategoryTypeCode(int code) {
        for (CategoryTypeEnums flagEnum : CategoryTypeEnums.values()) {
            if (flagEnum.code == code) {
                return flagEnum;
            }

        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
